package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.po.User;
import com.zhijian.warehouse.manage.entity.vo.request.UserSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**
     * 根据工号进行查询
     *
     * @param jobNumber
     * @return
     */
    User selectByJobNumber(String jobNumber);

    /**
     * 查询总数
     *
     * @param userSearchVo
     * @return
     */
    int count(UserSearchVo userSearchVo);

    /**
     * 查询列表
     *
     * @param userSearchVo
     * @return
     */
    List<UserVo> selectList(UserSearchVo userSearchVo);
    
    List<UserVo> selectListMsg(UserSearchVo userSearchVo);

    /**
     * 查询单个
     *
     * @param userSearchVo
     * @return
     */
    UserVo selectOne(UserSearchVo userSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    UserVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param userSearchVo
     * @return
     */
    void deleteByCondition(UserSearchVo userSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<User> entities);
}
